home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / languages / pcq_incl3v1.lha / Devices / PrtBase.i < prev    next >
Encoding:
Text File  |  1994-04-15  |  6.3 KB  |  146 lines

  1. {
  2.         PrtBase.i for PCQ Pascal
  3.  
  4.         printer device data definition
  5. }
  6.  
  7. {$I "Include:Exec/Nodes.i"}
  8. {$I "Include:Exec/Lists.i"}
  9. {$I "Include:Exec/Ports.i"}
  10. {$I "Include:Exec/Libraries.i"}
  11. {$I "Include:Exec/Tasks.i"}
  12. {$I "Include:Devices/Parallel.i"}
  13. {$I "Include:Devices/Serial.i"}
  14. {$I "Include:Devices/Timer.i"}
  15. {$I "Include:Libraries/DosExtens.i"}
  16. {$I "Include:Intuition/Intuition.i"}
  17.  
  18. Type
  19.  
  20.     DeviceData = record
  21.         dd_Device       : Library;      { standard library node }
  22.         dd_Segment      : Address;      { A0 when initialized }
  23.         dd_ExecBase     : Address;      { A6 for exec }
  24.         dd_CmdVectors   : Address;      { command table for device commands }
  25.         dd_CmdBytes     : Address;      { bytes describing which command queue }
  26.         dd_NumCommands  : Short;        { the number of commands supported }
  27.     end;
  28.     DeviceDataPtr = ^DeviceData;
  29.  
  30. Const
  31.  
  32.     P_STKSIZE           = $0800;        { stack size for child task }
  33.     P_BUFSIZE           = 256;          { size of internal buffers for text i/o }
  34.     P_SAFESIZE          = 128;          { safety margin for text output buffer }
  35.  
  36. Type
  37.  
  38.     PrinterData = record
  39.         pd_Device       : DeviceData;
  40.         pd_Unit         : MsgPort;      { the one and only unit }
  41.         pd_PrinterSegment : Address;    { the printer specific segment }
  42.         pd_PrinterType  : Short;        { the segment printer type }
  43.                                         { the segment data structure }
  44.         pd_SegmentData  : Address;      { (PrinterSegmentPtr) }
  45.         pd_PrintBuf     : Address;      { the raster print buffer }
  46.         pd_PWrite       : Address;      { the write function }
  47.         pd_PBothReady   : Address;      { write function's done }
  48.         pd_ior0         : IOExtPar;     { or IOExtSer: port I/O request }
  49.         pd_ior1         : IOExtPar;     { or IOExtSer: for double buffering }
  50.         pd_TIOR         : TimeRequest;  { timer I/O request }
  51.         pd_IORPort      : MsgPort;      {   and message reply port }
  52.         pd_TC           : Task;         { write task }
  53.         pd_OldStk       : Array [0..P_STKSIZE-1] of Byte;
  54.                                         {   and stack space }
  55.         pd_Flags        : Byte;         { device flags }
  56.         pd_pad          : Byte;
  57.         pd_Preferences  : Preferences;  { the latest preferences }
  58.         pd_PWaitEnabled : Byte; { wait function switch }
  59.         { New fields for V2.0 }
  60.         pd_Flags1       : Byte;                { padding }
  61.         pd_Stk          : Array[0..P_STKSIZE-1] of Byte;        { stack space }
  62.     end;
  63.     PrinterDataPtr = ^PrinterData;
  64.  
  65. Const
  66.  
  67. { Printer Class }
  68.  
  69.     PPCB_GFX            = 0;            { graphics (bit position) }
  70.     PPCF_GFX            = 1;            { graphics (and/or flag) }
  71.     PPCB_COLOR          = 1;            { color (bit position) }
  72.     PPCF_COLOR          = 2;            { color (and/or flag) }
  73.  
  74.     PPC_BWALPHA         = 0;            { black&white alphanumerics }
  75.     PPC_BWGFX           = 1;            { black&white graphics }
  76.     PPC_COLORALPHA      = 2;            { color alphanumerics }
  77.     PPC_COLORGFX        = 3;            { color graphics }
  78.  
  79. { Color Class }
  80.  
  81.     PCC_BW              = 1;            { black&white only }
  82.     PCC_YMC             = 2;            { yellow/magenta/cyan only }
  83.     PCC_YMC_BW          = 3;            { yellow/magenta/cyan or black&white }
  84.     PCC_YMCB            = 4;            { yellow/magenta/cyan/black }
  85.     PCC_4COLOR          = 4;            { a flag for YMCB and BGRW }
  86.     PCC_ADDITIVE        = 8;            { not ymcb but blue/green/red/white }
  87.     PCC_WB              = 9;            { black&white only, 0 == BLACK }
  88.     PCC_BGR             = 10;           { blue/green/red }
  89.     PCC_BGR_WB          = 11;           { blue/green/red or black&white }
  90.     PCC_BGRW            = 12;           { blue/green/red/white }
  91.  
  92. {
  93.         The picture must be scanned once for each color component, as the
  94.         printer can only define one color at a time.  ie. If 'PCC_YMC' then
  95.         first pass sends all 'Y' info to printer, second pass sends all 'M'
  96.         info, and third pass sends all C info to printer.  The CalComp
  97.         PlotMaster is an example of this type of printer.
  98. }
  99.  
  100.     PCC_MULTI_PASS      = $10;          { see explanation above }
  101.  
  102. Type
  103.  
  104.     PrinterExtendedData = record
  105.         ped_PrinterName : String;       { printer name, null terminated }
  106.         ped_Init        : Address;      { called after LoadSeg }
  107.         ped_Expunge     : Address;      { called before UnLoadSeg }
  108.         ped_Open        : Address;      { called at OpenDevice }
  109.         ped_Close       : Address;      { called at CloseDevice }
  110.         ped_PrinterClass : Byte;        { printer class }
  111.         ped_ColorClass  : Byte;         { color class }
  112.         ped_MaxColumns  : Byte;         { number of print columns available }
  113.         ped_NumCharSets : Byte;         { number of character sets }
  114.         ped_NumRows     : Short;        { number of 'pins' in print head }
  115.         ped_MaxXDots    : Integer;      { number of dots max in a raster dump }
  116.         ped_MaxYDots    : Integer;      { number of dots max in a raster dump }
  117.         ped_XDotsInch   : Short;        { horizontal dot density }
  118.         ped_YDotsInch   : Short;        { vertical dot density }
  119.         ped_Commands    : Address;      { printer text command table }
  120.         ped_DoSpecial   : Address;      { special command handler }
  121.         ped_Render      : Address;      { raster render function }
  122.         ped_TimeoutSecs : Integer;      { good write timeout }
  123.  
  124.         { the following only exists if the segment version is >= 33 }
  125.  
  126.         ped_8BitChars   : Address;      { conv. strings for the extended font }
  127.         ped_PrintMode   : Integer;      { set if text printed, otherwise 0 }
  128.  
  129.         { the following only exists if the segment version is >= 34 }
  130.         { ptr to conversion function for all chars }
  131.  
  132.         ped_ConvFunc    : Address;
  133.     end;
  134.     PrinterExtendedDataPtr = ^PrinterExtendedData;
  135.  
  136.  
  137.     PrinterSegment = record
  138.         ps_NextSegment  : Address;      { (actually a BPTR) }
  139.         ps_runAlert     : Integer;      { MOVEQ #0,D0 : RTS }
  140.         ps_Version      : Short;        { segment version }
  141.         ps_Revision     : Short;        { segment revision }
  142.         ps_PED          : PrinterExtendedData;  { printer extended data }
  143.     end;
  144.     PrinterSegmentPtr = ^PrinterSegment;
  145.  
  146.